package com.hulk.ratel;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.Banner;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.ConfigurableApplicationContext;

import java.util.Arrays;

/**
 * @author hulk
 */
@Slf4j
@SpringBootApplication
public class ApplicationBootstrap {

	public static void main(String[] args) {

		// java -jar xxx.jar --spring.profiles.active=test 命令启动具体的环境参数
		ConfigurableApplicationContext applicationContext = new SpringApplicationBuilder()
				.sources(ApplicationBootstrap.class)
				.bannerMode(Banner.Mode.OFF).run(args);
		String[] activeProfiles = applicationContext.getEnvironment().getActiveProfiles();
		log.info("service started successfully." + "\r\n" + "The following profiles are active: "
				+ Arrays.toString(activeProfiles));
	}

}
